package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties("handler")
public class StrategyCatalog extends BaseDomain {
    public static final boolean STATE_ENABLE = true;//启用
    public static final boolean STATE_DISABLE = false;//禁用

    private String name;

    private Long strategyId;

    private String strategyTitle;

    private Integer sequence;

    private boolean state;

    private List<StrategyDetail> details = new ArrayList<>();

    public String getStateName() {
        String str = "启用";
        if (state == STATE_DISABLE) {
            str = "禁用";
        }
        return str;
    }
    public Object getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("strategyId",strategyId);
        map.put("strategyTitle",strategyTitle);
        map.put("sequence",sequence);
        map.put("state",state);
        return JSON.toJSONString(map);
    }



}